package com.edu.bean;

/**
 * @Author:mx
 * @Date :2022/10/24 - 10 - 24 - 20:19
 */
/*
 *  创建需要被Spring管理的类
 * */
public class User {

    private String username;

    private String password;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        System.out.println("执行了username的 SET方法");
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        System.out.println("执行了password的 SET方法");
        this.password = password;
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }

    public User() {
        System.out.println("执行了 User类的构造方法");
    }

    public User(String username, String password) {
        System.out.println("执行了 有参数的构造方法 ");
        this.username = username;
        this.password = password;
    }
}